#pragma once
#include "RBTree.h"

namespace simulation
{
	template <class K>
	class Myset
	{
		struct KeyOfSet
		{
			const K& operator()(const K& data)
			{
				return data;
			}
		};
	public:
		typedef typename RBTree<K, K, KeyOfSet>::const_iterator iterator;
		typedef typename RBTree<K, K, KeyOfSet>::const_iterator const_iterator;
		pair<iterator, bool> insert(const K& key)
		{
			return _rbTree.insert(key);
		}
		iterator find(const K& key) const
		{
			return _rbTree.find(key);
		}

		// iterator
		iterator begin() const
		{
			return _rbTree.begin();
		}
		iterator end() const
		{
			return _rbTree.end();
		}
		
	private:
		typedef RBTree<K, K, KeyOfSet> rb_type;
		RBTree<K, K, KeyOfSet> _rbTree;
	};
}